package com.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.yizisu.music.and.roomdblibrary.bean.AlbumInfoTable;
import com.yizisu.music.and.roomdblibrary.bean.SingerInfoTable;
import com.yizisu.music.and.roomdblibrary.bean.SongInfoTable;
import com.yizisu.music.and.roomdblibrary.bean.SongWithAlbum;
import com.yizisu.music.and.roomdblibrary.bean.SongWithSinger;

import com.greendao.gen.AlbumInfoTableDao;
import com.greendao.gen.SingerInfoTableDao;
import com.greendao.gen.SongInfoTableDao;
import com.greendao.gen.SongWithAlbumDao;
import com.greendao.gen.SongWithSingerDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig albumInfoTableDaoConfig;
    private final DaoConfig singerInfoTableDaoConfig;
    private final DaoConfig songInfoTableDaoConfig;
    private final DaoConfig songWithAlbumDaoConfig;
    private final DaoConfig songWithSingerDaoConfig;

    private final AlbumInfoTableDao albumInfoTableDao;
    private final SingerInfoTableDao singerInfoTableDao;
    private final SongInfoTableDao songInfoTableDao;
    private final SongWithAlbumDao songWithAlbumDao;
    private final SongWithSingerDao songWithSingerDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        albumInfoTableDaoConfig = daoConfigMap.get(AlbumInfoTableDao.class).clone();
        albumInfoTableDaoConfig.initIdentityScope(type);

        singerInfoTableDaoConfig = daoConfigMap.get(SingerInfoTableDao.class).clone();
        singerInfoTableDaoConfig.initIdentityScope(type);

        songInfoTableDaoConfig = daoConfigMap.get(SongInfoTableDao.class).clone();
        songInfoTableDaoConfig.initIdentityScope(type);

        songWithAlbumDaoConfig = daoConfigMap.get(SongWithAlbumDao.class).clone();
        songWithAlbumDaoConfig.initIdentityScope(type);

        songWithSingerDaoConfig = daoConfigMap.get(SongWithSingerDao.class).clone();
        songWithSingerDaoConfig.initIdentityScope(type);

        albumInfoTableDao = new AlbumInfoTableDao(albumInfoTableDaoConfig, this);
        singerInfoTableDao = new SingerInfoTableDao(singerInfoTableDaoConfig, this);
        songInfoTableDao = new SongInfoTableDao(songInfoTableDaoConfig, this);
        songWithAlbumDao = new SongWithAlbumDao(songWithAlbumDaoConfig, this);
        songWithSingerDao = new SongWithSingerDao(songWithSingerDaoConfig, this);

        registerDao(AlbumInfoTable.class, albumInfoTableDao);
        registerDao(SingerInfoTable.class, singerInfoTableDao);
        registerDao(SongInfoTable.class, songInfoTableDao);
        registerDao(SongWithAlbum.class, songWithAlbumDao);
        registerDao(SongWithSinger.class, songWithSingerDao);
    }
    
    public void clear() {
        albumInfoTableDaoConfig.clearIdentityScope();
        singerInfoTableDaoConfig.clearIdentityScope();
        songInfoTableDaoConfig.clearIdentityScope();
        songWithAlbumDaoConfig.clearIdentityScope();
        songWithSingerDaoConfig.clearIdentityScope();
    }

    public AlbumInfoTableDao getAlbumInfoTableDao() {
        return albumInfoTableDao;
    }

    public SingerInfoTableDao getSingerInfoTableDao() {
        return singerInfoTableDao;
    }

    public SongInfoTableDao getSongInfoTableDao() {
        return songInfoTableDao;
    }

    public SongWithAlbumDao getSongWithAlbumDao() {
        return songWithAlbumDao;
    }

    public SongWithSingerDao getSongWithSingerDao() {
        return songWithSingerDao;
    }

}
